package com.common.sdk.net.download.db;

public class DownloadDetailesTables {
    /**文件下载详情*/
    public static final String DOWNLOAD_DB_FILE_DETAILE = "file_detailed";
    /**线程下载详情*/
    public static final String DOWNLOAD_DB_THREAD_DETAILE = "thread_detailed";

    /**DOWNLOAD_DB_FILE_DETAILE 表数据****************************************/

    public static final String KEY = "key";// 下载文件唯一标识
    public static final String TYPE = "type";// 下载类型
    public static final String STATE = "state";// 下载文件状态
    public static final String DOWNLOAD_PATH = "download_path";// 下载的路径
    public static final String FILESIZE = "filesize";// 下载文件的总大小
    public static final String THREAD_NUM = "thread_num";// 需要下载的线程数量
    public static final String ALREADY_SIZE = "already_size";// 已经下载的文件总大小
    public static final String SD_PATH = "sd_path";// 下载的文件SD卡文件路径
    public static final String DOWNLOAD_TIME = "download_time";// 下载时间
    public static final String ISBUILD = "isbuild";// 是否安装
    public static final String VERSION_CODE = "version_code";// 版本号
    public static final String FILE_NAME = "file_name";// 文件名称
    public static final String SUFFIX_NAME = "suffix_name";//  文件后缀名 
    public static final String DOWNLOAD_SOURCE = "download_source";// 下载来源
    public static final String DOWNLOAD_PRIORITY = "download_priority";// 下载优先级
    public static final String PACKAGE_NAME = "package_name";// 包名
    public static final String DOWNLOAD_PATH_TWO = "download_path_two";// 包名
    public static final String CATE_CODE = "cate_code";// 包名
    public static final String ICON_PATH = "icon_pic_path";// icon图片地址

    /**DOWNLOAD_DB_THREAD_DETAILE 表数据**************************************/

    public static final String THREAD_ID = "thread_id";
    public static final String THREAD_START_BYTE = "thread_start_byte";// 线程开始下载字节
    public static final String THREAD_END_BYTE = "thread_end_byte";// 线程结束字节

    /**
     * 创建文件下载详情数据库
     * @return
     */
    public static String getCreateFileDetailedTable() {
        String sql = "CREATE TABLE IF NOT EXISTS " + //
                DOWNLOAD_DB_FILE_DETAILE + " " + //
                "(id integer PRIMARY KEY AUTOINCREMENT," + //
                KEY + " char," + //
                TYPE + " integer," + //
                STATE + " integer," + //
                DOWNLOAD_PATH + " char," + //
                FILESIZE + " long," + //
                THREAD_NUM + " integer," + //
                ALREADY_SIZE + " long," + //
                SD_PATH + " char," + //
                DOWNLOAD_TIME + " char," + //
                ISBUILD + " integer," + //
                VERSION_CODE + " integer," + //
                FILE_NAME + " char," + //
                SUFFIX_NAME + " char," + //
                DOWNLOAD_SOURCE + " integer," + //
                DOWNLOAD_PRIORITY + " integer," + //
                PACKAGE_NAME + " char," + //
                DOWNLOAD_PATH_TWO + " char," + //
                CATE_CODE + " integer," + //
                ICON_PATH + " char)";
        return sql;
    }

    /**
     * 创建程下载详情
     * @return
     */
    public static String getCreateThreadDetailed() {
        String sql = "CREATE TABLE IF NOT EXISTS " + //
                DOWNLOAD_DB_THREAD_DETAILE + " " + //
                "(id integer PRIMARY KEY AUTOINCREMENT," + //
                KEY + " char," + //
                STATE + " integer," + //
                THREAD_ID + " integer," + //
                THREAD_START_BYTE + " long," + //
                THREAD_END_BYTE + " long)";
        return sql;
    }
}
